<?php
		$j = (isset($_POST["j"])) ? htmlentities($_POST["j"]) : NULL;

	$connect = "host=localhost port=5432 dbname=bdPimc user=jpivi password=alienation"; //parametre de connection
		$ressource_connect = pg_connect( $connect ); //pour se connecter

		$req = "SELECT * from hydrophone;";

		$req = pg_query( $ressource_connect , $req );

		$i = 0;
		while ( $info = pg_fetch_assoc ( $req )  ) //on met la requete sous forme de tableau 
		{
		 $x[$i]=$info["positionx"];
		$i = $i + 1;
		}

		echo $x[$j];
		
?>
